
import { defineStore } from 'pinia';

import { reqTypeNavList, reqBannerList, reqFloorList } from '@/api/home';

export const useHomeStoreListData = defineStore('home', {
  state() {
    return {
      typeNavList: [],
      bannerList: [],
      floorList: []
    };
  },
  actions: {
    // 获取二级导航分类数据
    async getTypeNavData() {
      const result = await reqTypeNavList();
      // console.log('sdf', result);
      this.typeNavList = result.data;
    },

    async getBannerData() {
      const result = await reqBannerList();
      // console.log('banner', result);
      this.bannerList = result.data;
    },

    async getFloorData() {
      const result = await reqFloorList();
      // console.log('floor', result);
      this.floorList = result.data;
    }
  },


});
